package com.young.springdemo.service.policy;

//儿童折扣的具体实现类
//儿童票大于20的－10,年龄小于10岁
public class ChildrenDiscount implements Discount {

    private static final double discount = 10;

    @Override
    public double calcute(double price) {
        System.out.println("儿童票进行打折");
        if (price > 20) {
            return price - discount;
        } else {
            return price;
        }
    }
}
